/*
 * Copyright (C) 2006-2015
 * 版权所有者为北京捷越联合信息咨询有限公司。本系统是商用软件,未经授权擅自复制或传播本程序的部分或全部将是非法的。
 * @title: IDealMode.java
 * @package com.jy.modules.cims.plan
 * @author zhaox
 * @date 2015-3-5 下午2:56:30
 * @version v1.00
 * @description: TODO(用一句话描述该文件做什么)
 */

package com.jy.modules.cims.component.creditRight.plan;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.jy.modules.cims.data.dto.credit.PlanChangeDTO;

/**
 * @classname: DealMode
 * @description: TODO(这里用一句话描述这个类的作用)
 */
@Service("com.jy.modules.cims.component.creditRight.plan.DealModeChain")
public class DealModeChain implements DealModeFilter {

    List<DealModeFilter> filters = new ArrayList<DealModeFilter>();

    public DealModeChain addFilter(DealModeFilter f) {
        this.filters.add(f);
        return this;
    }


    @Override
    public void doFilter(int index,PlanChangeDTO planChangeDTO, DealModeChain dealModeChain) {
        if (index == filters.size())
            return;
        DealModeFilter f = filters.get(index);
        f.doFilter(index,planChangeDTO, dealModeChain);
    }

}
